package com.stagepayserver.payserver.service.impl;


import com.stagepayserver.payserver.mapper.PayMapper;
import com.stagepayserver.payserver.service.PayService;
import com.stagecommon.common.vo.PayVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: yxl
 * @since: 2022-01-06
 **/
@Slf4j
@Service
public class PayServiceImpl implements PayService {

    @Autowired(required = false)
    private PayMapper payMapper;

    @Override
    public int saveOrder(PayVo payVo) {
        return payMapper.saveOrder(payVo);
    }

    @Override
    public int updateOrderStatus(String payTradeNum) {
        return payMapper.updateOrderStatus(payTradeNum);
    }

    @Override
    public Long selectOrderId(String payTradeNo) {
        return payMapper.searchOrderId(payTradeNo);
    }

    @Override
    public Integer selectPayStatus(String subject, Long orderId) {
        return payMapper.searchPayStatus(subject, orderId);
    }

    @Override
    public String searchSubject(String payTradeNum) {
        return payMapper.searchSubject(payTradeNum);
    }

}
